//
//  FTBaseCell.h
//  WebPDA
//
//  Created by Justin Yip on 8/15/10.
//  Copyright 2010 TenNights.com. All rights reserved.
//

#import <UIKit/UIKit.h>

/*
 base cell with a label
 */
@interface FTBaseCell : UITableViewCell {
	UILabel *label;
	NSBundle *formBundle;
	
	id valueHolder;
	//current ps
	NSDictionary *preferenceSpecifier;
}

/*
 init the cell retain the form bundle
 @param bundle
 @param observer
 @param reuseIdentifier 
 we use the class name for reuseIdentifier
 */
-(id)initWithBundle:(NSBundle*)bundle valueHolder:(id)object reuseIdentifier:(NSString *)reuseIdentifier;

/*
 configure the cell using value holder and PreferenceSpecifier dictionary
 @param object KVC object
 @param preferenceSpecifier
 */
-(void)configureWithObject:(id)object preferenceSpecifier:(NSDictionary*)preferenceSpecifier;

/*
 a callback method when the cell was selected
 */
-(void)didSelected:(UINavigationController *)navigationController;

/*
 current value of the cell, retrieve by FormTable component
 FormTable will invoke this method when the cell is prepare for reuse
 */
-(id)getValue;

-(NSString*)keyFromPreferenceSpecifier;

@property(nonatomic,retain)UILabel *label;
@property(nonatomic,retain)NSBundle *formBundle;
@property(nonatomic,retain)id valueHolder;
@property(nonatomic,copy)NSDictionary *preferenceSpecifier;
@end

#define CELL_MARGIN_LEFT 10
#define CELL_LABEL_WIDTH 100
#define CELL_APPEND_RECT CGRectMake(CELL_MARGIN_LEFT + CELL_LABEL_WIDTH, 12, 180, 25)